<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
          name="viewport">
    <meta content="ie=edge" http-equiv="X-UA-Compatible">
    <title>Document</title>
</head>
<body>
<div id="root">

</div>
<script>
    let result = 0
    for (let i = 1; i <= 20; i++) {
        let num = 1
        for (let j = 1; j <= i; j++) {
            num *= j
        }
        result += num
    }
    document.write(result)

</script>

</body>
</html>